<%if params[:category_id].to_i == cat.id.to_i%>
<span class=selected_label>
<%else%>
<span class=label id=label_<%=cat.id%> onmouseover="$('label_<%=cat.id%>').style.background='#F0F0F0'" onmouseout="$('label_<%=cat.id%>').style.background='#E5E5E5'">
<%end%>
<%if project%>
<%if label == "files"%>
  <%=link_to cat.name,project_file_in_category_path(cat.project_id,cat.id)%>(<%=size = cat.files.size%>)
<%elsif label == "writeboards"%>
  <%=link_to cat.name,project_wb_in_category_path(cat.project_id,cat.id)%>(<%=size = cat.writeboards.size%>)
<%else%>
  <%=link_to cat.name,project_msg_in_category_path(cat.project_id,cat.id)%>(<%=size = cat.messages.size%>)
<%end%>
<%else%>
  &nbsp; <b><%=cat.name%></b>
<%end%>
</span>
<span class='edit_item' id="edit_item_<%=cat.id%>"> 
<%if size==0%>
<%=link_to_remote image_tag("trash.gif",:border=>0),
	:confirm=>'Are you sure?'.t,
	:loading=>"Element.show('indicator_#{cat.id}');Element.hide('edit_item_#{cat.id}');new Effect.Highlight('cat_item_#{cat.id}')",
	:complete =>"Element.hide('indicator')",
	:url=>{:controller=>'categories',:action=>'destroy',:id=>cat.id} %>
<%end%>
<%if not project%>
<%=link_to_remote image_tag("trash.gif",:border=>0),
	:confirm=>'Are you sure?'.t,
	:loading=>"Element.show('indicator_#{cat.id}');Element.hide('edit_item_#{cat.id}');new Effect.Highlight('cat_item_#{cat.id}')",
	:complete =>"Element.hide('indicator')",
	:url=>{:controller=>'categories',:action=>'destroy',:id=>cat.id,:new_cat=>new_cat} %>
<%end%>
<%=link_to_remote "Rename".t,
	:update=>'cat_item_' + cat.id.to_s,
	:loading=>"Element.show('indicator_#{cat.id}');Element.hide('edit_item_#{cat.id}')",
	:complete =>"Element.hide('indicator')",
        :url=>{:controller=>'categories',:action=>'edit',:id=>cat.id}
%>
</span>
<span class='edit_item'>
<%=indicator(cat.id)%>
</span>

